<html>
	<?php
		require_once("classes/User.php");
		require_once("classes/Head.php");
		require_once("classes/Section.php");
		require_once("classes/Image.php");
		require_once("classes/Title.php");
		require_once("classes/Form.php");
		require_once("classes/Paragraph.php");
		require_once("classes/LinkList.php");
		
		session_start();
		
		$head = new Head();
		
		$head->addTitle("Ofertas de Emprego - Registo");
		$head->addLayout("css/style.css");
		$head->printHead();
	?>
	<body id="body">
		<div id="struture">
			<div id="container">
		        <?php
		        	$header = new Section("header");					
						$header->addElement(new Image("images/job.png", "logo", "100px", "100px"));
						
						$title = new Title("Ofertas de Emprego", "title");
						$header->addElement($title);
					$header->printSection();
					
		        	$leftPage = new Section("leftPage");
					if(isset($_SESSION["msg"])){
						$leftPage->addElement(new Title("Erro", "menuTitle"));
						$leftPage->addElement(new Paragraph($_SESSION["msg"], "menu"));
						unset($_SESSION["msg"]);
					}else{
						$leftPage->addElement(new Title("Ajuda", "menuTitle"));
						$leftPage->addElement(new Paragraph("Introduza os seus dados de registo no formul&aacuterio, todos os dados s&atildeo obrigat&oacuterios.", "menu"));
						$voltar = new LinkList("menuEntry");
						$voltar->addLink("Voltar", "index.php", new Image("images/leave.png", "icon", "16px", "16px"));
						$leftPage->addElement($voltar);
					}
					$leftPage->printSection();
					
					$content = new Section("content");
					$content->addElement(new Title("Novo Registo", "seccaoTitle"));

					$form = new Form("scripts/validateRegistry.php", "POST", "formTable");
					$form->addInput("Nome:", "text", "name", "input", "", "", TRUE);
					$form->addInput("Username:", "text", "user", "input", "", "", TRUE);
					$form->addInput("Password:", "password", "pass", "input", "", "", TRUE);
					$form->addInput("E-mail:", "text", "mail", "input", "", "", TRUE);
					$form->openRadio("Tipo de Utilizador:");
						$form->addRadioOption("Candidato", "role", "radio", "candidate", "checked");
						$form->addRadioOption("Empresa", "role", "radio", "enterprise", "");
					$form->closeRadio();
					$form->addInput("", "submit", "", "button", "Registar", "", FALSE);

					$content->addElement($form);
					$content->printSection();
					
					$footer = new Section("footer");
						$text = new Paragraph("Copyright&copy Nuno Pombo", "");
						$footer->addElement($text);
					$footer->printSection();
		        ?>
			</div>
		</div>
	</body>
</html>